feat(http): guarded() consumer-side middleware guard wrapper (fs-http 0.5.0)#144
Conversation
Deploying fs-packages with
|
| Latest commit: |
89bcee0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://92ed346a.fs-packages.pages.dev |
| Branch Preview URL: | https://engineer-fs-http-guarded-mid.fs-packages.pages.dev |
Town Crier Review · 9/10 · PASS · 🔎 Independentfs-packages #144 · AC anchor: PR description (no kendo issue) · head Tip Reviewed the new No findings — clean against the review checklist. |
jasperboerhof
left a comment
There was a problem hiding this comment.
Auto-approved — Town Crier verdict PASS @Head, CI green, no open MAJOR+ thread. Our approval is our independent vote (approve-alongside): a peer's review / CHANGES_REQUESTED never withholds it — we verify every blocker ourselves, and a real one drops our own verdict below PASS. See the verdict comment + inline notes.
86170e9 to
89bcee0
Compare
Town Crier Review · 9/10 · PASS · 🤝 Confirmfs-packages #144 · AC anchor: PR description (no kendo issue linked) · head Tip Reviewed the additive guarded() consumer-side middleware wrapper and the fs-http 0.5.0 peer-range cascade at head 89bcee0; this corroborates our own prior PASS on this PR — B confirmed all four claims (CONTRAST-tested throw-swallow, zero-cast type assignability, complete 4-package peer cascade with clean lock hygiene, CI pending not red) still hold, and the two reviewed heads differ only by an unrelated rebase (content byte-identical). No defects found. No findings — clean against the review checklist. Bus thread · 1 prior review(s):
|
jasperboerhof
left a comment
There was a problem hiding this comment.
Auto-approved — Town Crier verdict PASS @Head, CI green, no open MAJOR+ thread. Our approval is our independent vote (approve-alongside): a peer's review / CHANGES_REQUESTED never withholds it — we verify every blocker ourselves, and a real one drops our own verdict below PASS. See the verdict comment + inline notes.
What
Adds
guarded()— a consumer-side, opt-in middleware guard wrapper — to@script-development/fs-http(0.4.1 → 0.5.0, additive/non-breaking). One generic wraps any of the three(arg) => voidmiddleware bodies so a side-effect throw cannot corrupt the interceptor chain:Why
fs-httpinvokes request/response/response-error middleware as synchronous, un-caught, un-awaited loops inside its axios interceptors. A throwing middleware body rejects a resolved 200 on the success path and masks the real API error on the error path. This is by design — the library stays sync-only + loud (the 2026-05-13 rejection of library-side try/catch holds). A 2026-07-02 fleet recon found every fs-http consumer (entreezuil ×6, emmie ×7, ublgenie ×2, BIO ×3) carries un-guarded middleware of exactly this shape; kendo already hand-guarded its own (WR-0078 / script-development/kendo#1538, n=2).Rather than hand-roll try/catch across ~18 bodies fleet-wide,
guarded()is the canonical primitive — the enforcement-ladder answer. It's opt-in at the registration site: loud library, defensive consumer. Default handler surfaces the swallowed throw viaconsole.error(visible to error trackers); pass aGuardedMiddlewareErrorHandlerto route it elsewhere. No re-throw.Proven closed (end-to-end, against the real interceptor loop)
onError.AxiosError, not the middleware's throw.guarded.ts100% coverage + 100% mutation (6/6).createHttpServiceand the interceptor loops are unchanged. Pre-1.0 peer-range cascade handled (loading 0.1.5 / adapter-store 0.3.1 / cached-adapter-store 0.2.4); lockfile synced, 0 nested registry copies.Pairs with the fs-packages
CLAUDE.md § Middleware Sync Contractdoctrine block (#143) — that block will be cross-linked toguarded()once both land. Precedent: war-roomdeferred.md [adr] fs-packages-fs-http-async-aware-middleware-rejection-doctrine.🤖 Generated with Claude Code